from django.shortcuts import render
from django.http import HttpResponse
from django.urls import  reverse 
# 新版本将旧版本的django.core.urlresolvers更换为django.urls

# Create your views here.

'''
视图函数需要一个参数，类型应该是HttpRequest
'''

def do_normalmap(request):
    return HttpResponse("This is normalmap")
    
def withparam(request, year, month):
    return HttpResponse("This is withparam {0},{1}".format(year,month))

def do_app(request):
    return HttpResponse("这是个子路由")

def do_param2(request, page_number):
    return HttpResponse("page_nunmber is {0}".format(page_number))

def extreParam(request, name):
    return HttpResponse("My name is {0}".format(name))

def revParse(request):
    return HttpResponse('Your requested URL is {0}'.format(reverse('askname')))
